import type { PageResult, PageParams } from "@/types/global";
import type { BannerItem, categoryItem, guessItem, hotPanelItem } from "@/types/home";
import { http } from "@/untils/request";

/**
 * 首页-广告区域-小程序
 * @param distributionSite 
 * @returns 
 */
export const getHomeBannerAPI = (distributionSite = 1) => {
    return http<BannerItem[]>({
        url: '/home/banner',
        method: 'GET',
        data: {
            distributionSite
        }
    })
}

/**
 * 首页-前台分类-小程序
 * @returns 
 */
export const getHomeCategoryAPI = () => {
    return http<categoryItem[]>({
        url: '/home/category/mutli',
        method: 'GET'
    })
}

/**
 * 首页-热门推荐-小程序
 * @returns 
 */
export const getHotMutliListAPI = () => {
    return http<hotPanelItem[]>({
        url: '/home/hot/mutli',
        method: 'GET'
    })
}

/**
 * 猜你喜欢-小程序
 * @param data 
 * @returns 
 */
export const getGuessLikeListAPI = (data: PageParams) => {
    return http<PageResult<guessItem>>({
        url: '/home/goods/guessLike',
        method: 'GET',
        data
    })
}